From c4cc67351030ce5a6c9150a4a59fccd147e8d477 Mon Sep 17 00:00:00 2001 From: Tim Deegan Date: Mon, 8 Oct 2007 09:40:49 +0100 Subject: [PATCH] [XEN] Shadow: fix locking in error path. Signed-off-by: TIm Deegan --- xen/arch/x86/mm/shadow/common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c index 04bc55deb4..97da7cf484 100644 --- a/xen/arch/x86/mm/shadow/common.c +++ b/xen/arch/x86/mm/shadow/common.c @@ -2372,13 +2372,13 @@ int shadow_enable(struct domain *d, u32 mode) unsigned int r; shadow_lock(d); r = sh_set_allocation(d, 256, NULL); /* Use at least 1MB */ - shadow_unlock(d); if ( r != 0 ) { sh_set_allocation(d, 0, NULL); rv = -ENOMEM; - goto out_unlocked; + goto out_locked; } + shadow_unlock(d); } /* Init the P2M table. Must be done before we take the shadow lock -- 2.30.2